//
//  Connection.h
//  Keyvaluecoding
//
//  Created by 赵洋 on 14/11/7.
//  Copyright (c) 2014年 赵洋. All rights reserved.
//

#import <Foundation/Foundation.h>
// 推荐页面网址全部用宏定义
// 最新
#define Firsturl    @"http://app.api.autohome.com.cn/autov4.2.5/news/newslist-a2-pm1-v4.2.5-c0-nt0-p1-s30-l0.html"
// 视频
#define secondurl   @"http://app.api.autohome.com.cn/autov4.2.5/news/videos-a2-pm1-v4.2.5-vt0-p1-s30.html"

#define threeurl    @"http://app.api.autohome.com.cn/autov4.2.5/news/newslist-a2-pm1-v4.2.5-c0-nt1-p1-s30-l0.html"

#define foururl @"http://app.api.autohome.com.cn/autov4.2.5/news/newslist-a2-pm1-v4.2.5-c0-nt3-p1-s30-l0.html"

#define fiveurl @"http://app.api.autohome.com.cn/autov4.2.5/news/newslist-a2-pm1-v4.2.5-c0-nt60-p1-s30-l0.html"

#define sixurl @"http://app.api.autohome.com.cn/autov4.2.5/news/newslist-a2-pm1-v4.2.5-c110100-nt2-p1-s30-l0.html"

#define sevenurl @"http://app.api.autohome.com.cn/autov4.2.5/news/newslist-a2-pm1-v4.2.5-c0-nt82-p1-s30-l0.html"

#define eighturl @"http://app.api.autohome.com.cn/autov4.2.5/news/newslist-a2-pm1-v4.2.5-c0-nt102-p1-s30-l0.html"

#define nineurl @"http://app.api.autohome.com.cn/autov4.2.5/news/newslist-a2-pm1-v4.2.5-c0-nt97-p1-s30-l0.html"

#define tenurl @"http://app.api.autohome.com.cn/autov4.2.5/news/newslist-a2-pm1-v4.2.5-c0-nt107-p1-s30-l0.html"

#define elevenurl @"http://app.api.autohome.com.cn/autov4.2.5/news/newslist-a2-pm1-v4.2.5-c0-nt100-p1-s30-l0.html"

#define twiveurl @"http://app.api.autohome.com.cn/autov4.2.5/news/videos-a2-pm1-v4.2.5-vt8-p1-s30.html"
#define thirdurl @"http://app.api.autohome.com.cn/autov4.2.5/news/shuokelist-a2-pm1-v4.2.5-p1-s30.html"

typedef void(^finishedBlock)(NSData *data);


@interface Connection : NSObject<NSURLConnectionDataDelegate>
@property (nonatomic, retain) NSMutableData *recieve;
@property (nonatomic, retain) NSString *urlname;
@property (nonatomic, copy)finishedBlock datablock;
// post封装加号方法
+ (void)PostconnectWithUrl:(NSString *)url body:(NSString *)body block:(finishedBlock)block;

// get封装加号方法
+ (void)GetConnectWithUrl:(NSString *)url value:(NSMutableDictionary *)value block:(finishedBlock)block;
// 判断
+ (BOOL)judgeConnectEnabled;


- (void)startWithUrl:(NSString *)url value:(NSMutableDictionary *)value;
- (void)startWithPostUrl:(NSString *)url body:(NSString *)body;


@end
